<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
		<input type="hidden" name="id" value="{$item['id']}" />
		<div class='panel'>
			<div class='panel-body tab-content'>
			
				<div class="tab-pane active" id="tab_basic">
					{template 'web/manage/tab_basic'}
				</div>
	
			</div>
			
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
					<div class="col-sm-9 col-xs-12">
						<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
						<input type="hidden" name="token" value="{$_W['token']}" />
						<input type="hidden" name="data" value="" />
						<input type="button" name="back" onclick='history.back()' style='margin-left:10px;' value="返回列表" class="btn btn-default" />
					</div>
				</div>
			</div>

		</div>
	</form>
</div>
<script>
	$('form').submit(function() {
		if($(':input[name=title]').isEmpty()) {
			Tip.focus($(':input[name=title]'), '请输入海报名称!');
			return false;
		}
		// 任务海报
		var data = [];
		$('.drag0').each(function() {
			var obj = $(this);
			var type = obj.attr('type');
			var left = obj.css('left'),
				top = obj.css('top');
			var d = {
				left: left,
				top: top,
				type: obj.attr('type'),
				width: obj.css('width'),
				height: obj.css('height')
			};
			if(type == 'nickname' || type == 'title' || type == 'marketprice' || type == 'productprice' || type == 'mobile' || type == 'date' || type == 'days' || type == 'ratio' || type == 'relay' || type == 'clock' || type == 'time' || type == 'realname' || type == 'company' || type == 'relayday') {
				d.size = obj.attr('size');
				d.color = obj.attr('color');
			} else if(type == 'qr') {
				d.size = obj.attr('size');
			} else if(type == 'xcxqr') {
				d.size = obj.attr('size');
			} else if(type == 'img') {
				d.src = obj.attr('src');
			}
			data.push(d);
		});
		$(':input[name=data]').val(JSON.stringify(data));

		// 推荐者返回海报
		var data1 = [];
		$('.drag1').each(function() {
			var obj = $(this);
			var type = obj.attr('type');
			var left = obj.css('left'),
				top = obj.css('top');
			var d = {
				left: left,
				top: top,
				type: obj.attr('type'),
				width: obj.css('width'),
				height: obj.css('height')
			};
			if(type == 'nickname' || type == 'createtime') {
				d.size = obj.attr('size');
				d.color = obj.attr('color');
			} else if(type == 'qr' || type == 'qrcode') {
				d.size = obj.attr('size');
			} else if(type == 'img') {
				d.src = obj.attr('src');
			}
			data1.push(d);
		});
		$('#poster_data').val(JSON.stringify(data1));


		return true;
	});
	
	$('#myTab li a').click(function(e){
		e.preventDefault(); 
		$('#myTab li').removeClass("active");
		$('.tab-content .tab-pane').hide();
		$(this).parent().addClass("active");
		$($(this).attr('href')).show();
	});
	
	$("input:radio[name=sendtype]").click(function(){
		$("#sendtype"+$(this).val()).show().siblings().hide();
	});
	
	$("input:radio[name=isopen_level]").click(function(){
		var val = $(this).val();
		if(val == 0){
			$(".level_type").hide();
		}
		if(val == 1){
			$(".level_type").show();
			$(".level_type_box1").show();
		}
	});
	
	$("input:radio[name=subresptype]").click(function(){
		var val = $(this).val();
		if(val == 0){
			$("#subresptype0").show();
			$("#subresptype1").hide();
		}
		if(val == 1){
			$("#subresptype0").hide();
			$("#subresptype1").show();
		}
	});
	
	
	$("input:radio[name=israndomimg]").click(function(){
		var val = $(this).val();
		if(val == 1){
			$("#israndomimg").show();
		}else{
			$("#israndomimg").hide();
		}
	});
	
	$("input:radio[name=isclock]").click(function(){
		var val = $(this).val();
		if(val == 1){
			$("#isclock").show();
		}else{
			$("#isclock").hide();
		}
	});
	
	$("input:radio[name=level_type]").click(function(){
		var val = $(this).val();
		$(".level_box").show();
		if(val == 1){
			$(".level1").show();
			$(".level2").hide();
			$(".level3").hide();
		}
		if(val == 2){
			$(".level1").show();
			$(".level2").show();
			$(".level3").hide();
		}
		if(val == 3){
			$(".level1").show();
			$(".level2").show();
			$(".level3").show();
		}
	});
</script>